<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>中间自适应布局</title>
</head>

<style>
  .container {
    display: flex;
  }

  .left {
    flex-basis: 300px;
    flex-shrink: 0;
  }

  .right {
    flex-basis: 300px;
    flex-shrink: 0;
  }

  .main {
    flex-grow: 1;
  }
</style>
<body>
  <h2>如何实现左右固定，中间自适应布局</h2>
  <div class="container">
    <div class="left">left</div>
    <div class="main">main</div>
    <div class="right">right</div>
  </div>
</body>
</html>